const pkg = require('./package');

module.exports = {
    mode: 'spa',

    /*
    ** Headers of the page
    */
    head: {
        title: '津贝尔管理系统',
        meta: [
            { charset: 'utf-8' },
            {
                name: 'viewport',
                content: 'width=device-width, initial-scale=1,user-scalable=no,maximum-scale=1.0, minimum-scale=1.0;',
            },
            { hid: 'description', name: 'description', content: pkg.description },
        ],
        link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
    },

    /*
    ** Customize the progress-bar color
    */
    loading: { color: '#fff' },

    /*
    ** Global CSS
    */
    css: ['assets/normalize.css'],

    /*
    ** Plugins to load before mounting the App
    */
    plugins: [
        '@/plugins/mintui',
        '@/plugins/spost',
        '@/plugins/table',
        '@/plugins/amap.js',
        '@/plugins/jsonp.js',
        '@/plugins/vant.js',
        '~/env',
    ],

    /*
    ** Nuxt.js modules
    */
    modules: [
        // Doc: https://github.com/nuxt-community/axios-module#usage
        '@nuxtjs/axios',
    ],
    /*
    ** Axios module configuration
    */
    axios: {
        // See https://github.com/nuxt-community/axios-module#options
    },

    /*
    ** Build configuration
    */
    build: {
        /*
        ** You can extend webpack config here
        */
        // extend (config, ctx) {
        //   // Run ESLint on save
        //   if (ctx.isDev && ctx.isClient) {
        //     config.module.rules.push ({
        //       enforce: 'pre',
        //       test: /\.(js|vue)$/,
        //       loader: 'eslint-loader',
        //       exclude: /(node_modules)/,
        //     });
        //   }
        // },
        // index: path.resolve (__dirname, '../dist/index.html'),
        // // Paths
        // assetsRoot: path.resolve (__dirname, '../dist'),
        // assetsSubDirectory: 'static',
        // assetsPublicPath: './',
    },
    node: {
        // prevent webpack from injecting useless setImmediate polyfill because Vue
        // source contains it (although only uses it if it‘s native).
        setImmediate: false,
        // prevent webpack from injecting mocks to Node native modules
        // that does not make sense for the client
        dgram: 'empty',
        fs: 'empty',
        net: 'empty',
        tls: 'empty',
        child_process: 'empty',
    },
};
